<?php 
$applyGiftLog = $this->applyGiftLog;
?>
<div class='center_form'>
    <div class="center_form_right">
        <div class='center_form_btn_div' onclick='javascript:Common.submit();'>
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/save.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("saveBtn"); ?></div>
        </div>
        
        <div class='center_form_btn_div' onclick="javascript:Common.deleteSubmit('<?php echo HttpUtil::baseUrl();?>/gift/applygiftlog/delete/id/<?php echo $this->id; ?>')">
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/delete.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("delBtn");?></div>
        </div>
        
        <div class='center_form_btn_div'  onclick='javascript:Common.gotoUrl("<?php echo HttpUtil::baseUrl(); ?>/gift/applygiftlog");'>
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/cancel.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("cancelBtn"); ?></div>
        </div>
    </div>
</div>
<?php if($applyGiftLog['apply_type'] == 1){?>
<div class="centerbig_form" style="margin-bottom:10px;">
    <div class="center_top"><span class="center_top_title"><?php echo $this->translate("couponInfo"); ?></span></div>
  
        <div class="right_form_content">            
               <div class="form_content">
					<table class="order_table"  cellspacing="0" cellpadding="0" border="0">
                          <tr>
                            <td class="table_header"><?php echo $this->translate("promotionShotDes"); ?>: </td>
                          	<td><?php echo $this->promotion['short_description'];?></td>
                          	<td class="table_header"><?php echo $this->translate("couponCode"); ?>: </td>
                          	<td><?php echo $applyGiftLog['coupon_code'];?></td>
                          	<td class="table_header"><?php echo $this->translate("status"); ?>: </td>
                          	<td><?php echo GiftConstant::getApplyCouponStatus($applyGiftLog['status']);?></td>	
                          </tr>
                         
                          <tr>
                          	<td class="table_header"><?php echo $this->translate("applyUsedPoint"); ?>: </td>
                          	<td><?php echo $applyGiftLog['points'];?></td>
                          	<td class="table_header"><?php echo $this->translate("currentUsedPointTotal"); ?>: </td>
                          	<td><?php echo $applyGiftLog['current_exhaust_points'];?></td>
                          	<td class="table_header"><?php echo $this->translate("currentAccumulatePointTotal"); ?>: </td>
                          	<td><?php echo $applyGiftLog['current_ac_points'];?></td>
                          </tr>
                          <tr>
                          	<td class="table_header"><?php echo $this->translate("userName"); ?>: </td>
                          	<td><?php echo $applyGiftLog['name'];?></td>
                          	<td class="table_header"><?php echo $this->translate("applyDate"); ?>: </td>
                          	<td><?php echo $applyGiftLog['created'];?></td>
                          	<td class="table_header"></td>
                          	<td></td>
                          </tr>
                          
                    </table>                          
                   
               </div>       
            </div>
        <div class="clear"></div>      
</div> 
<?php }?>
<?php if($applyGiftLog['apply_type'] == 2){?>
<div class="centerbig_form" style="margin-bottom:10px;">
    <div class="center_top"><span class="center_top_title"><?php echo $this->translate("giftInfo"); ?></span></div>
  
        <div class="right_form_content">            
               <div class="form_content">
					<table class="order_table"  cellspacing="0" cellpadding="0" border="0">
                          <tr>
                          	<td class="table_header"><?php echo $this->translate("title"); ?>: </td>
                          	<td colspan="3" ><?php echo $this->gift['title'];?></td>
                          	<td class="table_header"><?php echo $this->translate("status"); ?>: </td>
                          	<td><?php echo GiftConstant::getApplyGiftStatus($applyGiftLog['status']);?></td>
                          </tr>
                          <tr>
                          	<td class="table_header"><?php echo $this->translate("applyUsedPoint"); ?>: </td>
                          	<td><?php echo $applyGiftLog['points'];?></td>
                          	<td class="table_header"><?php echo $this->translate("currentUsedPointTotal"); ?>: </td>
                          	<td><?php echo $applyGiftLog['current_exhaust_points'];?></td>
                          	<td class="table_header"><?php echo $this->translate("currentAccumulatePointTotal"); ?>: </td>
                          	<td><?php echo $applyGiftLog['current_ac_points'];?></td>
                          </tr>
                          <tr>
                          	<td class="table_header"><?php echo $this->translate("userName"); ?>: </td>
                          	<td><?php echo $applyGiftLog['name'];?></td>
                          	<td class="table_header"><?php echo $this->translate("applyDate"); ?>: </td>
                          	<td><?php echo $applyGiftLog['created'];?></td>
                          	<td class="table_header"></td>
                          	<td></td>
                         </tr>
                          
                    </table>                          
                   
               </div>       
            </div>
        <div class="clear"></div>      
</div>

<div class="centerbig_form" style="margin-bottom:10px;">
    <div class="center_top"><span class="center_top_title"><?php echo $this->translate("shippingInfo"); ?></span></div>
    <div class="right_form_content">              
		   <div class="form_content">
		          <table class="order_table">
		               <tr>
                          	<td class="table_header"><?php echo $this->translate("receiver"); ?>: </td>
                          	<td><?php echo $applyGiftLog['delivery_name'];?></td>
                          	<td class="table_header"><?php echo $this->translate("phone"); ?>: </td>
                          	<td><?php echo $applyGiftLog['delivery_phone1'];?></td>
                          	<td class="table_header"><?php echo $this->translate("mobile"); ?>: </td>
                          	<td><?php echo $applyGiftLog['delivery_phone2'];?></td>
                        </tr> 
                        <tr>
                          	<td class="table_header"><?php echo $this->translate("receiverEmail"); ?>: </td>
                          	<td><?php echo $applyGiftLog['delivery_email'];?></td>
                          	<td class="table_header"><?php echo $this->translate("region"); ?>: </td>
                          	<td><?php echo $this->dict;?></td>
                          	<td class="table_header"></td>
                          	<td></td>
                        </tr>
                        <tr>
                          	<td class="table_header"><?php echo $this->translate("detailAddress"); ?>: </td>
                          	<td colspan="5" ><?php echo $applyGiftLog['delivery_detail_address'];?></td>
                        </tr>        
                  </table> 
           </div>
    </div>
    <div class="clear"></div>      
</div>   

<div class="centerbig_form" style="margin-bottom:10px;">
    <div class="center_top"><span class="center_top_title"><?php echo $this->translate("processInfo"); ?></span></div>
  
        <div class="right_form_content"> 
            <form action="<?php echo HttpUtil::baseUrl(); ?>/gift/applygiftlog/subedit" method="post" id="edit"> 
               <input type="hidden"  id="apply_type" name="apply_type" value="<?php echo $applyGiftLog['apply_type'];?>" />   
               <input type="hidden"  id="id" name="id" value="<?php echo $this->id;?>" />
               <input type="hidden"  id="points" name="points" value="<?php echo $applyGiftLog['points'];?>" /> 
               <input type="hidden"  id="user_id" name="user_id" value="<?php echo $applyGiftLog['user_id'];?>" />           
               <div class="form_content">
                  
                   <div class="form_line_div">
                       <div class="form_element_label"><?php echo $this->translate("shippingMethod"); ?>:</div>
                       <div class="form_element" style="margin-left:20px;">
                           <select id="shipping_method" name="shipping_method">
                               <?php foreach (OrderConstant::getShippingMethodList() as $key=>$shippingMethod){
                                if($key==$applyGiftLog['shipping_method_id']){
                                  	 $selected = "selected=selected";
                                  } else {
                                  	 $selected = "";
                                  }
                               	?>
                               <option value="<?php echo $key;?>" <?php echo $selected; ?> ><?php echo $shippingMethod;?></option>
                               <?php }?>
                            </select>
                       </div>
                       <div class="clear" ></div>
                       <div class="form_line_div">
                           <div id="shipping_method_error" class="form_element_error" style="margin-left:120px;"></div>
                       </div>
                       <div class="clear"></div>
                   </div>
                   
                   <div class="form_line_div">
                       <div class="form_element_label"><?php echo $this->translate("trackingNum"); ?>:</div>
                       <div class="form_element" style="margin-left:20px;">
                           <input type="text" name="tracking_num" id="tracking_num" value="<?php echo $applyGiftLog['tracking_num'];?>" />
                       </div>
                       <div class="clear" ></div>
                       <div class="form_line_div">
                           <div id="tracking_num_error" class="form_element_error" style="margin-left:120px;"></div>
                       </div>
                       <div class="clear"></div>
                   </div>
                  
                   <div class="form_line_div">
                       <div class="form_element_label"><?php echo $this->translate("status"); ?>:</div>
                       <div class="form_element" style="margin-left:20px;" >
                           <?php 
                           if($applyGiftLog['status'] == 4){
                               $disabled = "disabled=disabled";
                           } else {
                               $disable = "";
                           }
                           ?>
                           <select id="apply_gift_status" onchange="javascript:Gift.changApplyGiftStatus();" name="apply_gift_status" <?php echo $disabled; ?> >
                               <?php foreach (GiftConstant::getApplyGiftStatusList() as $key=>$status){
                                  if($key==$applyGiftLog['status']){
                                  	 $selected = "selected=selected";	 
                                  } else {
                                  	 $selected = "";
                                  }
                               	?>
                               <option value="<?php echo $key;?>" <?php echo $selected; ?> ><?php echo $status;?></option>
                               <?php }?>
                            </select>
                       </div>
                       <div class="clear" ></div>
                       <div class="form_line_div">
                           <div id="shipping_status_error" class="form_element_error" style="margin-left:120px;"></div>
                       </div>
                       <div class="clear"></div>
                   </div>
                  
					<div class="form_line_div">
                         <div class="form_element_label" ><?php echo $this->translate("description")?>:</div>
                         <div class="form_element" style="margin-left:20px;">
                             <textarea id="description" name="description" rows="3" cols="50"><?php echo $applyGiftLog['description'];?></textarea>
                         </div>
                    </div>
                    <div class="clear"></div>

               </div>  
            </form>     
         </div>
        <div class="clear"></div>      
</div> 
<?php } ?>
<input type="hidden" id="cur_status" value="<?php echo $applyGiftLog['status']?>" />
<input type="hidden" id="canNotCancelExchant" value="<?php echo $this->translate('canNotCancelExchangeInfo');?>" />